Add @xpecs/reativa package and split demo into view/impl tabs#9
Merged
Conversation
Expand the reativa (OCaml + Melange) examples into their own package, @xpecs/reativa — the ReasonML/OCaml sibling of @xpecs/xote — covering the same set xote does: 22 elements, 8 components, and 7 blocks, written in .mlx over Reativa.View with the same behaviour and accessibility semantics. Package (packages/reativa): - One module per component (Button, Alert, Dialog, Select, StatGrid, …) plus shared Ui/Icons/Icon and a generated Contracts.ml (enum prop types derived from the specs' `## API` contracts, so the OCaml compiler enforces the implementation can't drift from the spec — same guarantee as @xpecs/xote). - Registry.mlx renders one live example per spec (matching the website's Xote examples) and exports the JS surface the site consumes: mount_example, example_ids, built. - scripts/generate-contracts.mjs emits Contracts.ml; scripts/build.mjs clones reativa (pinned), compiles the sources inside its dune project with Melange, and bundles Registry.js to dist/reativa.bundle.js with esbuild. Website: - The example block now has two tab strips: view (Preview / Playground / Code) and implementation (Xote / Reativa). The implementation strip swaps which library renders the live preview; Code stays the Xote source. - ReativaExamples reads example_ids from the bundle so the two never drift; build-reativa.mjs builds @xpecs/reativa and copies its bundle into the site. - Removes the old single-file website/reativa proof-of-concept. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TmsZSd9fQyhGdd4JbX7QLp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expand the reativa (OCaml + Melange) examples into their own package, @xpecs/reativa — the ReasonML/OCaml sibling of @xpecs/xote — covering the same set xote does: 22 elements, 8 components, and 7 blocks, written in .mlx over Reativa.View with the same behaviour and accessibility semantics.
Package (packages/reativa):
## APIcontracts, so the OCaml compiler enforces the implementation can't drift from the spec — same guarantee as @xpecs/xote).Website: